  "use strict";
  document.write('<script src="./js/720/Gazer.js"></script>');
  var Reticle = function() {
    this.gazer = null;
    this.gazerTime = 0;

    this.configGazer();
  };

  Reticle.prototype = {

    // 注视
    configGazer: function() {
      // 添加准心
      this.gazer = new Gazer();
    },

    setLoadingEffect: function(isVR,renderer) {
      console.log('set loading effect .');
      console.log(isVR);
      let w = 20;
      let h = 20;
      if(isVR) {
        $("#loading_left").css('top', renderer.domElement.clientHeight / 2 - h / 2+'px');
        $("#loading_left").css('left', renderer.domElement.clientWidth / 4 - w / 2+'px');
        $("#loading_right").css('top', renderer.domElement.clientHeight / 2 - h / 2+'px');
        $("#loading_right").css('left', renderer.domElement.clientWidth / 2 + renderer.domElement.clientWidth / 4 - w / 2+'px');
      }
      else {
        $("#loading_left").css('top', renderer.domElement.clientHeight / 2 - h / 2+'px');
        $("#loading_left").css('left', renderer.domElement.clientWidth / 2 - w / 2+'px');
        $("#loading_right").css('top', renderer.domElement.clientHeight / 2 - h / 2+'px');
        $("#loading_right").css('left', renderer.domElement.clientWidth / 2 - w / 2+'px');
      }
    },

    resetLoadingPercent: function() {
      document.getElementById('loading_left').querySelector('.circle').classList.remove('clip-auto');
      document.getElementById('loading_left').querySelector('.right').classList.add('wth0');

      document.getElementById('loading_right').querySelector('.circle').classList.remove('clip-auto');
      document.getElementById('loading_right').querySelector('.right').classList.add('wth0');

      document.getElementById('loading_left').querySelector('.left').style.transform='rotate(0deg)';
      document.getElementById('loading_right').querySelector('.left').style.transform='rotate(0deg)';
    },

    setLoadingPercent: function(per) {
      if(per > 1) {
        this.resetLoadingPercent();
            return;
      }
  
          var percent = per * 360; 
  
        if(percent >= 360) {
            document.getElementById('loading_left').querySelector('.circle').classList.remove('clip-auto');
            document.getElementById('loading_left').querySelector('.right').classList.add('wth0');
  
            document.getElementById('loading_right').querySelector('.circle').classList.remove('clip-auto');
            document.getElementById('loading_right').querySelector('.right').classList.add('wth0');
        }else if(percent >= 180) {  
            document.getElementById('loading_left').querySelector('.circle').classList.add('clip-auto');
            document.getElementById('loading_left').querySelector('.right').classList.remove('wth0');
  
            document.getElementById('loading_right').querySelector('.circle').classList.add('clip-auto');
            document.getElementById('loading_right').querySelector('.right').classList.remove('wth0');
        }
        document.getElementById('loading_left').querySelector('.left').style.transform='rotate('+percent+'deg)';
        document.getElementById('loading_right').querySelector('.left').style.transform='rotate('+percent+'deg)';
    },

  };